<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <class name="YiLe.Model.Domain.Permission, YiLe.Model" table="Permissions" lazy="true" >
    <id name="PermissionID" column="PermissionID" type="int">
      <generator class="native" />
    </id>
    <property name="PermissionName">
      <column name="PermissionName" sql-type="nvarchar" not-null="true" />
    </property>
    <property name="PermissionType">
      <column name="PermissionType" sql-type="char" not-null="true" />
    </property>
    <property name="MenuID">
      <column name="MenuID" sql-type="int" not-null="true" />
    </property>
	<!-- 多对多关系：Permission属于多个Role lazy="true"-->
	<bag name="Roles" table="Roles_Permissions" >
		<key column="PermissionID"/>
		<many-to-many column="RoleID" class="YiLe.Model.Domain.Role, YiLe.Model" />
	</bag>
	  <!-- 一对一关系：Permission对应一个Menu
	  <one-to-one name="Menu" class="YiLe.Model.Domain.Menu, YiLe.Model" cascade="all"/>
	  <many-to-one name="Menu" class="YiLe.Model.Domain.Menu, YiLe.Model" column="MenuID" not-null="true" outer-join="auto"/> 
	  <many-to-one name="Menu" class="YiLe.Model.Domain.Menu, YiLe.Model" column="MenuID" unique="true"/>-->
  </class>
</hibernate-mapping>